﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace commodity.Models
{
    public class Goods
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Goods_Id { get; set; }
        [MaxLength(32)]
        [Required]
        public string Goods_Name { get; set; }
        [Required]
        public decimal Goods_Price { get; set; }
        [Required]
        public int Goods_Number { get; set; }
        public DateTime CreateTime { get; set; }
        public DateTime UpdateTime { get; set; }
        
        [ForeignKey("CommodityId")]
        public int CommodityId { get; set; }
        public Commodity commodity { get; set; }
       public ICollection<GoodsPicture> goodsPictures { get; set; } = new List<GoodsPicture>();
       public ICollection<GoodsInformation> goodsInformations { get; set; } = new List<GoodsInformation>();
    }
}
